﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Proposed_Export.ascx.cs" Inherits="ERP.Modules.Proposed_Export" %>
<script>
    var editExport_Detail = function (editor, e) {
        if (e.record.data.Proposed_Export_Quality_Sell > e.record.data.Proposed_Export_Quality_Still) {
            window.Ext.Msg.alert("Lỗi", "Số lượng xuất phải nhỏ hơn số lượng còn(Chưa xuất)!");
            e.record.reject();
        }
    };
</script>
<%-------------------------------%>
<ext:Hidden ID="FormatTypeProposed_Export" runat="server" />
<%--------------GridProposed_Export-----------------%>
<ext:Panel ID="PanelProposed_Export" runat="server" Layout="Fit" Border="False">
    <Content>
        <ext:GridPanel
            ID="grProposed_Export"
            runat="server"
            Cls="grid-double"
            EnableColumnMove="true"
            Border="False">
            <Store>
                <ext:Store
                    ID="StoreProposed_Export"
                    runat="server"
                    OnReadData="StoreProposed_Export_RefreshData"
                    PageSize="20">
                    <Model>
                        <ext:Model ID="ModelProposed_Export" runat="server" IDProperty="Proposed_Export_ID">
                            <Fields>
                                <ext:ModelField Name="Proposed_Export_No" Type="String" />
                                <ext:ModelField Name="Proposed_Export_TaxCode" Type="String" />
                                <ext:ModelField Name="FullName" Type="String" />
                                <ext:ModelField Name="FullNameRespone" Type="String" />
                                <ext:ModelField Name="Proposed_Export_DateBegin" Type="Date" />
                                <ext:ModelField Name="Proposed_Export_DateRespone" Type="Date" />
                                <ext:ModelField Name="Proposed_Export_Descripttion" Type="String" />
                                <ext:ModelField Name="IsActive" Type="Boolean" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" Text="STT" runat="server" Width="35" Align="Center" />
                    <ext:Column ID="Column1" runat="server" Text="Mã phiếu" Width="100" DataIndex="Proposed_Export_No" Align="Center"></ext:Column>
                    <ext:Column ID="Column2" runat="server" Text="Người lập phiếu" Width="200" DataIndex="FullName" Align="Center"></ext:Column>
                    <ext:Column ID="Column4" runat="server" Text="Người duyệt" Width="200" DataIndex="FullNameRespone" Align="Center"></ext:Column>
                    <ext:DateColumn ID="Column5" runat="server" Text="Ngày lập phiếu" Width="200" DataIndex="Proposed_Export_DateBegin" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                    <ext:DateColumn ID="Column3" runat="server" Text="Ngày xét duyệt" Width="200" DataIndex="Proposed_Export_DateRespone" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                    <ext:CheckColumn ID="Column13" runat="server" Text="Trạng thái" Width="100" DataIndex="IsActive" Flex="1" Align="Center"></ext:CheckColumn>
                </Columns>
            </ColumnModel>
            <Features>
                <ext:Grouping ID="Grouping1"
                    runat="server"
                    HideGroupedHeader="true"
                    GroupByText="Xem theo phân nhóm"
                    ShowGroupsText="Phân nhóm"
                    GroupHeaderTplString="{name} ({rows.length} danh mục con {[values.rows.length > 1 ? '' : '']})"
                    StartCollapsed="True" />
                <ext:GridFilters runat="server" ID="GridFilters1" Local="true">
                    <Filters>
                        <ext:BooleanFilter DataIndex="IsActive" />
                    </Filters>
                </ext:GridFilters>
            </Features>
            <DirectEvents>
                <ItemDblClick OnEvent="Proposed_ExportDblClick">
                    <ExtraParams>
                        <ext:Parameter Name="Proposed_Export_ID" Value="record.data.Proposed_Export_ID" Mode="Raw" />
                    </ExtraParams>
                    <EventMask ShowMask="true" Msg="Đang tải..." />
                </ItemDblClick>
            </DirectEvents>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModelProposed_Export" runat="server" Mode="Multi">
                    <DirectEvents>
                        <Select OnEvent="Cell_Click">
                            <EventMask ShowMask="false" Msg="Đang tải..." />
                        </Select>
                    </DirectEvents>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <View>
                <ext:GridView ID="GridView1" runat="server" StripeRows="true" />
            </View>
            <DockedItems>
                <ext:Toolbar ID="ToolbarTopMain" runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnAddNew" runat="server" Text="Thêm mới" Icon="ApplicationAdd">
                            <DirectEvents>
                                <Click OnEvent="btnAddNew_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="ApplicationEdit">
                            <DirectEvents>
                                <Click OnEvent="btnEdit_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnDel" runat="server" Text="Xoá" Icon="ApplicationDelete">
                            <DirectEvents>
                                <Click OnEvent="btnDel_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn xoá mẫu tin này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnProposed_Export_Review" runat="server" Text="Xét duyệt" Icon="Tick" ToolTip="Check vào một phiếu đề nghị để xét duyệt">
                            <DirectEvents>
                                <Click OnEvent="btnProposed_Export_Review_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                            <Menu>
                                <ext:Menu ID="MenuMain" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                            <Listeners>
                                                <Click Handler="submitValue(#{grProposed_Export}, #{FormatTypeProposed_Export}, 'xml');" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:FormPanel runat="server" ID="Filter" Layout="HBox" Border="False">
                            <Items>
                                <ext:DateField ID="txtDateBeginFillter" EmptyText="Từ ngày" AllowBlank="False" BlankText="Vui lòng chọn ngày" runat="server" MarginSpec="0 8 0 0" />
                                <ext:DateField ID="txtDateEndFillter" EmptyText="Đến ngày" AllowBlank="False" BlankText="Vui lòng chọn ngày" runat="server" />
                            </Items>
                        </ext:FormPanel>
                        <ext:Button ID="btnFillter" runat="server" Text="Lọc" Icon="ApplicationGo" ToolTip="Chọn lọc theo ngày đặt hàng">
                            <DirectEvents>
                                <Click OnEvent="btnFillter_Click" Before="return #{Filter}.isValid();">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:SelectBox
                            ID="SelectBoxReview"
                            runat="server"
                            Cls="x-select-box"
                            MarginSpec="0 8 0 0"
                            EmptyText="Chọn trạng thái">
                            <Items>
                                <ext:ListItem Value="true" Text="Đã duyệt" />
                                <ext:ListItem Value="false" Text="Chưa duyệt" />
                            </Items>
                            <DirectEvents>
                                <Select OnEvent="SetFilter">
                                </Select>
                            </DirectEvents>
                        </ext:SelectBox>
                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="ToolbarPagging" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                                <TriggerClick OnEvent="Search_Event"></TriggerClick>
                                <KeyPress OnEvent="Search_Event"></KeyPress>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:PagingToolbar ID="PagingToolbarProposed_Export" runat="server" StoreID="StoreProposed_Export" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
<ext:Panel runat="server">
    <Content>
        <%-----------WindowsProposed_Export-----------------%>
        <ext:Window ID="WindowsProposed_Export" runat="server"
            Title="Cập nhật phiếu xuất kho"
            Width="850"
            Height="565"
            Hidden="true"
            Region="Center"
            Modal="true"
            HideMode="Display"
            Border="false"
            Padding="5"
            DefaultButton="btnSavePopUp"
            Resizable="False">
            <Items>
                <ext:Toolbar ID="ToolbarProposed_Export" runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Lưu lại" Icon="Disk" ID="btnSavePopUp">
                            <DirectEvents>
                                <Click OnEvent="btnSavePopUp_Click" Before="return #{FormPanelProposed_Export}.isValid();">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="grProposed_Export_Detail" Value="Ext.encode(#{grProposed_Export_Detail}.getRowsValues({selectedOnly : false}))" Mode="Raw" />
                                    </ExtraParams>
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:Button runat="server" Text="Huỷ bỏ" Icon="Decline" ID="btnCancelPopUp">
                            <DirectEvents>
                                <Click OnEvent="btnCancelPopUp_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:TextField ID="txtProposed_Export_ID" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                    </Items>
                </ext:Toolbar>
                <ext:FormPanel ID="FormPanelProposed_Export" runat="server"
                    AutoHeight="true"
                    BodyPadding="10"
                    Frame="true">
                    <Items>
                        <ext:FieldContainer runat="server" Layout="HBox">
                            <Items>
                                <ext:FieldSet ID="FieldSetInfoLeft"
                                    runat="server"
                                    Title="Thông tin khách hàng"
                                    PaddingSpec="0 10 0 10"
                                    MarginSpec="0 10 0 0"
                                    Width="500"
                                    DefaultAnchor="100%">
                                    <Items>
                                        <ext:FieldContainer runat="server" Layout="HBoxLayout">
                                            <Items>
                                                <ext:Hidden runat="server" ID="Customer_ID"></ext:Hidden>
                                                <ext:TextField ID="txtCustomerAliasProposed_Export" ReadOnly="True" FieldCls="readonly" runat="server" FieldLabel="Mã khách hàng" MarginSpec="0 3 0 0"></ext:TextField>
                                                <ext:TextField ID="txtCustomerNameProposed_Export" ReadOnly="True" FieldCls="readonly" runat="server"></ext:TextField>
                                            </Items>
                                        </ext:FieldContainer>
                                        <ext:TextField ID="txtProposed_Export_TaxCode" runat="server" FieldLabel="Mã số thuế"></ext:TextField>
                                        <ext:TextField ID="txtAddressProposed_Export" ReadOnly="True" FieldCls="readonly" runat="server" FieldLabel="Địa chỉ"></ext:TextField>
                                        <ext:TextArea ID="txtProposed_Export_Descripttion" runat="server" FieldLabel="Diễn giải"></ext:TextArea>
                                    </Items>
                                </ext:FieldSet>
                                <ext:FieldSet ID="FieldSetInfoRight"
                                    runat="server"
                                    Title="Chứng từ"
                                    PaddingSpec="0 10 0 10"
                                    Width="298"
                                    Height="162"
                                    DefaultAnchor="100%">
                                    <Items>
                                        <ext:Hidden runat="server" ID="ID_Sell"></ext:Hidden>
                                        <ext:TriggerField ID="abc" runat="server" FieldLabel="Chứng từ bán hàng">
                                            <Triggers>
                                                <ext:FieldTrigger Icon="SimpleGet" />
                                            </Triggers>
                                            <ToolTips>
                                                <ext:ToolTip ID="ToolTip1"
                                                    runat="server"
                                                    Html="Chọn vật tư từ đơn bán hàng"
                                                    AutoHide="true">
                                                </ext:ToolTip>
                                            </ToolTips>
                                            <DirectEvents>
                                                <TriggerClick OnEvent="btnOrderSell_Click">
                                                    <EventMask ShowMask="true" Msg="Đang tải..."></EventMask>
                                                </TriggerClick>
                                            </DirectEvents>
                                        </ext:TriggerField>
                                        <ext:TextField ID="txtProposed_Export_No" runat="server" FieldLabel="Mã phiếu đề nghị" />
                                        <ext:DateField ID="txtProposed_Export_DateBegin" runat="server" FieldLabel="Ngày đặt hàng" />
                                    </Items>
                                </ext:FieldSet>
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldSet ID="FieldSetInfoMaterial"
                            runat="server"
                            Title="Thông tin vật tư"
                            PaddingSpec="0 10 10 10"
                            Width="807"
                            Height="300"
                            DefaultAnchor="100%"
                            Layout="Fit">
                            <Items>
                                <ext:GridPanel
                                    ID="grProposed_Export_Detail"
                                    Cls="grid-double"
                                    runat="server"
                                    EnableColumnMove="true">
                                    <Store>
                                        <ext:Store
                                            ID="StoreProposed_Export_Detail"
                                            runat="server"
                                            OnReadData="StoreProposed_Export_Detail_RefreshData">
                                            <Model>
                                                <ext:Model ID="ModelProposed_Export_Detail" runat="server" IDProperty="Proposed_Export_Detail_ID">
                                                    <Fields>
                                                        <ext:ModelField Name="Proposed_Export_ID" Type="Int" />
                                                        <ext:ModelField Name="Sell_ID" Type="Int" />
                                                        <ext:ModelField Name="Materials_ID" Type="String" />
                                                        <ext:ModelField Name="Materials_Alias" Type="String" />
                                                        <ext:ModelField Name="Materials_Name" Type="String" />
                                                        <ext:ModelField Name="Unit_Name" Type="String" />
                                                        <ext:ModelField Name="Proposed_Export_Quality" Type="Int" />
                                                        <ext:ModelField Name="Proposed_Export_Quality_Sell" Type="Int" />
                                                        <ext:ModelField Name="Proposed_Export_Quality_Still" Type="Int" />
                                                        <ext:ModelField Name="Proposed_Export_Detail_Price" Type="Float" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <ColumnModel runat="server">
                                        <Columns>
                                            <ext:RowNumbererColumn ID="RowNumbererColumn2" Text="STT" runat="server" Width="30" Align="Center" />
                                            <ext:Column ID="Column8" runat="server" Text="Mã hàng" Width="100" DataIndex="Materials_Alias" />
                                            <ext:Column ID="Column9" runat="server" Text="Tên hàng" Width="100" DataIndex="Materials_Name" />
                                            <ext:Column ID="Column12" runat="server" Text="SL Bán" Width="90" DataIndex="Proposed_Export_Quality" />
                                            <ext:Column ID="Column7" runat="server" Text="SL còn(Chưa xuất)" Width="90" DataIndex="Proposed_Export_Quality_Still" />
                                            <ext:Column ID="Column27" runat="server" Text="SL Xuất" Width="90" DataIndex="Proposed_Export_Quality_Sell">
                                                <Editor>
                                                    <ext:NumberField ID="NumberField1" runat="server" MinValue="0">
                                                    </ext:NumberField>
                                                </Editor>
                                            </ext:Column>
                                            <ext:Column ID="Column10" runat="server" Text="Đơn vị tính" Width="90" DataIndex="Unit_Name" />
                                            <ext:Column ID="Column11" runat="server" AllowBlank="false" MinValue="0" Text="Giá vốn" Width="90" DataIndex="Proposed_Export_Detail_Price" Flex="1">
                                                <Renderer Fn="Ext.util.Format.numberRenderer('0,000')" />
                                            </ext:Column>
                                        </Columns>
                                    </ColumnModel>
                                    <Plugins>
                                        <ext:RowEditing ID="RowEditing1" runat="server" SaveBtnText="Cập nhật" CancelBtnText="Hủy bỏ">
                                            <Listeners>
                                                <Edit Fn="editExport_Detail"></Edit>
                                            </Listeners>
                                        </ext:RowEditing>
                                    </Plugins>
                                    <SelectionModel>
                                        <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi" />
                                    </SelectionModel>
                                </ext:GridPanel>

                            </Items>
                        </ext:FieldSet>
                    </Items>
                </ext:FormPanel>
            </Items>
        </ext:Window>
        <%--------------Material-----------------%>
        <ext:Window ID="WindowProposed_Export_OrderSell_Materials" runat="server"
            Title="Thông tin vật tư"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets"
            Constrain="True">
            <Content>
                <ext:GridPanel
                    ID="grProposed_Export_Materials"
                    Border="True"
                    runat="server"
                    AutoWidth="true"
                    AutoScroll="true"
                    Cls="gird"
                    EnableColumnMove="true">
                    <Store>
                        <ext:Store
                            ID="StoreProposed_Export_Materials"
                            runat="server"
                            OnReadData="StoreProposed_Export_Materials_RefreshData"
                            PageSize="10">
                            <Model>
                                <ext:Model ID="Model4" runat="server" IDProperty="Materials_Id">
                                    <Fields>
                                        <ext:ModelField Name="ID_Sell" Type="Int" />
                                        <ext:ModelField Name="Materials_Id" Type="Int" />
                                        <ext:ModelField Name="Materials_Alias" Type="String" />
                                        <ext:ModelField Name="Materials_Name" Type="String" />
                                        <ext:ModelField Name="Unit_Name" Type="String" />
                                        <ext:ModelField Name="Sell_Detail_Quanlity" Type="Int" />
                                        <ext:ModelField Name="Quanlity" Type="Int" />
                                        <ext:ModelField Name="Quality_Current" Type="Int" />
                                        <ext:ModelField Name="Sell_Detail_Quality_Remain" Type="Int" />
                                        <ext:ModelField Name="Price_Initially" Type="Float" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn ID="Column16" runat="server" Text="STT" Width="35" Align="Center"></ext:RowNumbererColumn>
                            <ext:Column ID="Column18" runat="server" Text="ID Vật Tư" Width="15" Visible="false" DataIndex="Materials_Id"></ext:Column>
                            <ext:Column ID="Column6" runat="server" Text="Mã vật tư" Width="100" DataIndex="Materials_Alias"></ext:Column>
                            <ext:Column ID="Column19" runat="server" Text="Tên vật tư" Width="100" DataIndex="Materials_Name" Align="Left"></ext:Column>
                            <ext:Column ID="Column20" runat="server" Text="Tồn kho" Width="100" DataIndex="Quality_Current" Align="Center"></ext:Column>
                            <ext:NumberColumn ID="NumberColumn1" runat="server" Text="Giá gốc" Width="150" DataIndex="Price_Initially" Format="0,00" Align="Center"></ext:NumberColumn>
                            <ext:Column ID="Column14" runat="server" Text="Đơn vị tính" Width="100" DataIndex="Unit_Name" Align="Center" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CheckboxSelectionModel ID="CheckboxSelectionModel2" runat="server" Mode="Multi" />
                    </SelectionModel>
                    <TopBar>
                        <ext:Toolbar ID="Toolbar3" runat="server">
                            <Items>
                                <ext:ComboBox runat="server"
                                    ID="cbProposed_Export"
                                    Editable="false"
                                    SelectOnFocus="true"
                                    ForceSelection="True"
                                    FieldLabel="Đơn bán hàng:" Width="250"
                                    DisplayField="Sell_Code"
                                    ValueField="ID_Sell"
                                    EmptyText="Chọn đơn bán hàng"
                                    Margins="0 20 0 0"
                                    AllowBlank="false"
                                    ContextMenuID="cbProposed_ExportContext">
                                    <Store>
                                        <ext:Store runat="server" ID="Proposed_ExportStore" OnReadData="ReloadComboBox">
                                            <Model>
                                                <ext:Model runat="server" IDProperty="ID_Sell">
                                                    <Fields>
                                                        <ext:ModelField Name="Sell_Code" Type="String" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <DirectEvents>
                                        <Select OnEvent="cbProposed_ExportSelectIndex_Change">
                                            <EventMask ShowMask="true" Msg="Đang tải..."></EventMask>
                                        </Select>
                                    </DirectEvents>
                                </ext:ComboBox>
                                <ext:Button ID="btnSelectProposed_Export_Materials" runat="server" Text="Chọn vật tư" Icon="Accept" ToolTip="Chọn vật tư">
                                    <DirectEvents>
                                        <Click OnEvent="btnSelectProposed_Export_Materials_Click">
                                            <EventMask ShowMask="true" Msg="Đang tải..." />
                                            <ExtraParams>
                                                <ext:Parameter Name="grProposed_Export_Materials" Value="Ext.encode(#{grProposed_Export_Materials}.getRowsValues({selectedOnly : true}))" Mode="Raw" />
                                                <ext:Parameter Name="grProposed_Export_Detail" Value="Ext.encode(#{grProposed_Export_Detail}.getRowsValues({selectedOnly : false}))" Mode="Raw" />
                                            </ExtraParams>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <DockedItems>
                        <ext:Toolbar ID="ToolBarMaterial" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="txtSearchMaterial" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchMaterial_Event"></TriggerClick>
                                        <KeyPress OnEvent="SearchMaterial_Event"></KeyPress>
                                        <KeyUp OnEvent="SearchMaterial_Event"></KeyUp>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:PagingToolbar ID="PagingToolbarMaterialWithOrder" runat="server" StoreID="StoreProposed_Export_Materials" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
        <%----------------WindowsOrderReview-----------------%>
        <ext:Window ID="WindowProposed_ExportReview" runat="server"
            Title="Xét duyệt đề nghị xuất hàng"
            DefaultAnchor="100%"
            Width="829"
            Height="605"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="false"
            Modal="true"
            HideMode="Offsets">
            <Content>
                <ext:Panel ID="Panel2"
                    runat="server"
                    Cls="width"
                    Layout="Fit"
                    Dock="Top"
                    ButtonAlign="Left"
                    AutoScroll="true">
                    <DockedItems>
                        <ext:Toolbar ID="Toolbar1" runat="server" Dock="Top">
                            <Items>
                                <ext:Button ID="btnReviewWindow" runat="server" Text="Xét duyệt" Icon="Tick" ToolTip="Xét duyệt mẫu tin">
                                    <DirectEvents>
                                        <Click OnEvent="btnReviewWindow_Click">
                                            <EventMask ShowMask="true" Msg="Đang tải..." />
                                            <Confirmation ConfirmRequest="true"
                                                Title="Thông Báo" Message="Bạn có muốn xét duyệt phiếu đề nghị xuất hàng này không ?">
                                            </Confirmation>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:ToolbarSeparator />
                                <ext:Button ID="btnUnReviewWindow" runat="server" Text="Bỏ xét duyệt" Icon="Cross" ToolTip="Huỷ xét duyệt mẫu tin">
                                    <DirectEvents>
                                        <Click OnEvent="btnUnReviewWindow_Click">
                                            <EventMask ShowMask="true" Msg="Đang tải..." />
                                            <Confirmation ConfirmRequest="true"
                                                 Title="Thông Báo" Message="Bạn có muốn huỷ xét duyệt phiếu đề nghị xuất hàng này không ?">
                                            </Confirmation>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:ToolbarSeparator />
                                <ext:Button ID="btnExitReviewOrder" runat="server" Text="Đóng lại" Icon="Cancel" ToolTip="Đóng cửa sổ xét duyệt">
                                    <Listeners>
                                        <Click Handler="#{WindowProposed_ExportReview}.hide();"></Click>
                                    </Listeners>
                                </ext:Button>
                                <ext:TextField ID="txtReviewProposed_Export_ID" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:Panel>
                <ext:FormPanel ID="FormPanel1"
                    runat="server"
                    Width="817"
                    Height="569"
                    Border="false"
                    Frame="true"
                    DefaultAnchor="100%">
                    <Items>
                        <ext:FieldSet ID="FieldSet1"
                            runat="server"
                            Title="Thông tin khách hàng"
                            MarginSpec="0 8 0 0"
                            Padding="10"
                            Height="210px"
                            ButtonAlign="Right">
                            <Defaults>
                                <ext:Parameter Name="Width" Value="500" />
                                <ext:Parameter Name="LabelWidth" Value="90" />
                            </Defaults>
                            <Items>
                                <ext:Container ID="Container1" runat="server" Layout="HBoxLayout">
                                    <Items>
                                        <ext:Label ID="Label1" runat="server" Text="Mã khách hàng:" MarginSpec="0 8 15 0"></ext:Label>
                                        <ext:Label ID="lbReviewCustomer_Alias" Cls="x-label-right" runat="server" Text=""></ext:Label>

                                    </Items>
                                </ext:Container>

                                <ext:Container ID="Container2" runat="server" Layout="HBoxLayout">
                                    <Items>
                                        <ext:Label ID="Label2" runat="server" Text="Tên khách hàng:" MarginSpec="0 8 15 0"></ext:Label>
                                        <ext:Label ID="lbReviewCustomer_Name" Cls="x-label-right" runat="server" Text=""></ext:Label>
                                    </Items>
                                </ext:Container>

                                <ext:Container ID="Container3" runat="server" Layout="HBoxLayout">
                                    <Items>
                                        <ext:Label ID="Label3" runat="server" Text="Chứng từ đặt:" MarginSpec="0 8 15 0"></ext:Label>
                                        <ext:Label ID="lbReviewOrderCode" Cls="x-label-right" runat="server" Text=""></ext:Label>
                                    </Items>
                                </ext:Container>

                                <ext:Container ID="Container4" runat="server" Layout="HBoxLayout">
                                    <Items>
                                        <ext:Label ID="Label4" runat="server" Text="Ngày đặt hàng:" MarginSpec="0 8 15 0"></ext:Label>
                                        <ext:Label ID="lbReviewOrderDate" Cls="x-label-right" runat="server" Text=""></ext:Label>
                                    </Items>
                                </ext:Container>

                                <ext:Container ID="Container5" runat="server" Layout="HBoxLayout">
                                    <Items>
                                        <ext:Label ID="Label5" runat="server" Text="Ngày duyệt/huỷ:" MarginSpec="0 8 15 0"></ext:Label>
                                        <ext:Label ID="lbReviewDateUpdate" Cls="x-label-right" runat="server" Text=""></ext:Label>
                                    </Items>
                                </ext:Container>

                                <ext:Container ID="Container6" runat="server" Layout="HBoxLayout">
                                    <Items>
                                        <ext:Label ID="Label6" runat="server" Text="Thời gian duyệt/huỷ vào lúc:" MarginSpec="0 8 15 0"></ext:Label>
                                        <ext:Label ID="lbReViewTime" Cls="x-label-right" runat="server" Text=""></ext:Label>
                                    </Items>
                                </ext:Container>
                            </Items>
                        </ext:FieldSet>
                        <ext:FieldSet ID="FieldSet2"
                            runat="server"
                            Title="Thông tin vật tư"
                            PaddingSpec="0 10 10 10"
                            Width="807"
                            Height="230"
                            DefaultAnchor="100%"
                            Layout="Fit">
                            <Items>
                                <ext:GridPanel
                                    ID="grReview"
                                    Cls="grid-double"
                                    runat="server"
                                    EnableColumnMove="true">
                                    <Store>
                                        <ext:Store
                                            ID="StoreReview"
                                            runat="server"
                                            OnReadData="StoreReview_RefreshData">
                                            <Model>
                                                <ext:Model ID="Model1" runat="server" IDProperty="Proposed_Export_Detail_ID">
                                                    <Fields>
                                                        <ext:ModelField Name="Proposed_Export_ID" Type="Int" />
                                                        <ext:ModelField Name="Sell_ID" Type="Int" />
                                                        <ext:ModelField Name="Materials_ID" Type="String" />
                                                        <ext:ModelField Name="Materials_Alias" Type="String" />
                                                        <ext:ModelField Name="Materials_Name" Type="String" />
                                                        <ext:ModelField Name="Unit_Name" Type="String" />
                                                        <ext:ModelField Name="Proposed_Export_Quality" Type="Int" />
                                                        <ext:ModelField Name="Proposed_Export_Quality_Sell" Type="Int" />
                                                        <ext:ModelField Name="Proposed_Export_Quality_Still" Type="Int" />
                                                        <ext:ModelField Name="Proposed_Export_Detail_Price" Type="Float" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <ColumnModel runat="server">
                                        <Columns>
                                            <ext:RowNumbererColumn ID="RowNumbererColumn3" Text="STT" runat="server" Width="30" Align="Center" />
                                            <ext:Column ID="Column15" runat="server" Text="Mã hàng" Width="100" DataIndex="Materials_Alias" />
                                            <ext:Column ID="Column17" runat="server" Text="Tên hàng" Width="100" DataIndex="Materials_Name" />
                                            <ext:Column ID="Column21" runat="server" Text="SL Bán" Width="90" DataIndex="Proposed_Export_Quality" />
                                            <ext:Column ID="Column23" runat="server" Text="SL Xuất" Width="90" DataIndex="Proposed_Export_Quality_Sell">
                                                <Editor>
                                                    <ext:NumberField ID="NumberField2" runat="server" MinValue="0">
                                                    </ext:NumberField>
                                                </Editor>
                                            </ext:Column>
                                            <ext:Column ID="Column24" runat="server" Text="Đơn vị tính" Width="90" DataIndex="Unit_Name" />
                                            <ext:Column ID="Column25" runat="server" AllowBlank="false" MinValue="0" Text="Giá vốn" Width="90" DataIndex="Proposed_Export_Detail_Price" Flex="1">
                                                <Renderer Fn="Ext.util.Format.numberRenderer('0,000')" />
                                            </ext:Column>
                                        </Columns>
                                    </ColumnModel>
                                </ext:GridPanel>
                            </Items>
                        </ext:FieldSet>
                    </Items>
                </ext:FormPanel>
            </Content>
        </ext:Window>
        <ext:Menu runat="server" ID="cbProposed_ExportContext">
            <Items>
                <ext:Button ID="Button7" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbProposed_Export}.clearValue(); #{Proposed_ExportStore}.reload(); #{cbProposed_ExportContext}.hide(); #{StoreProposed_Export_Materials}.reload();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
    </Content>
</ext:Panel>